<?
        $results = array();
        require_once('../inc/ContactInfo.php');
        if(isset($_POST['id']))
        {
                $row = $_POST;
                $results = SaveContact($row['id']);
                if($results === true)
                {
                        header("Location: index.php");
                        die();
                }
        }else{
                $row = GetMethod($_REQUEST['id'], 'ContactInfo');
        }
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Contact Info Details</title>
    <link rel="stylesheet" type="text/css" href="../inc/bootstrap.css">
    <style type="text/css" ">
        .error { color: red; }
    </style>
</head>
<body>
        <? include('../inc/header.php'); ?>
        <div class="container">
                        <? include('../inc/nav.php'); ?>
            <div id="contents"> 
                        <dl class="error">
                        <? foreach ($results as $key => $value): ?>
                                                <dt><?=$key?></dt>
                                                <dd><?=$value?></dd>
                        <? endforeach; ?>
                </dl>              
                <form class="form-horizontal" method="post" action="">
                        <input type="hidden" name="id" value="<?=$row['id']?>" />
                    <div class="control-group">
                        <label class="control-label" for="Customers_id">Customer ID Number:</label>
                        <div class="controls">
                            <input type="text" name="Customers_id" id="Customers_id" value="<?=$row['Customers_id']?>" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="ContactInfoType_id">Contact Information Type:</label>
                        <div class="controls">
                            <input type="text" name="ContactInfoType_id" id="ContactInfoType_id" value="<?=$row['ContactInfoType_id']?>" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Info">Information:</label>
                        <div class="controls">
                            <input type="text" name="Info" id="Info" value="<?=$row['Info']?>" />
                        </div>
                    </div>
                        <div class="control-group">
                        <label class="control-label" for="created_at">created_at:</label>
                        <div class="controls">
                            <input type="text" name="created_at" id="created_at" value="<?=$row['created_at']?>" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="updated_at">updated_at:</label>
                        <div class="controls">
                            <input type="text" name="updated_at" id="updated_at" value="<?=$row['updated_at']?>" />
                        </div>
                    </div>
                    <input class="btn btn-primary" type="submit" value="Save" />
                </form>
           </div>
       </div>
</body>
</html>
